<script  setup>
import { ref } from 'vue'
const username = ref('')
const userList = ref([])
const page = ref(1)
const size = ref(5)
const total = ref(0)
</script>

<template>
<el-card>
 <div style="display: flex; justify-content: space-between; align-items: center;">
   <el-form>
    <el-form-item label="用户名:">
      <el-input v-model="username" placeholder="请输入用户名"></el-input>
    </el-form-item>
  </el-form>
  <div>
    <el-button type="primary">搜索</el-button>
    <el-button>重置</el-button>
  </div>
 </div>
</el-card>
<el-card style="margin-top: 20px;">
    <el-button type="primary">添加</el-button>
    <el-button type="danger">批量删除</el-button>
     <el-table :model="userList" border style="margin-top: 20px;">
      <el-table-column type="selection"></el-table-column>
      <el-table-column label="序号" type="index" width="100px"></el-table-column>
      <el-table-column label="id" prop="username"></el-table-column>
      <el-table-column label="用户名字" prop="email"></el-table-column>
      <el-table-column label="用户名称" prop="mobile"></el-table-column>
      <el-table-column label="用户角色" prop="role_name"></el-table-column>
      <el-table-column label="创建时间" prop="role_name"></el-table-column>
      <el-table-column label="更新时间" prop="role_name"></el-table-column>
      <el-table-column label="操作">
        <template #default="{$index,row}">
           <el-button type="primary">分配角色</el-button>
           <el-button type="danger">编辑</el-button>
           <el-button type="danger">删除</el-button>
        </template>
      </el-table-column>
     </el-table>
     <div style="margin-top: 20px;">
       <el-pagination
      v-model:current-page="page"
      v-model:page-size="size"
      :page-sizes="[5,10,15]"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
     </div>

</el-card>
</template>

<style scoped lang="scss">

</style>